/*
 * Copyright (c) 2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef SECURE_ELEMENT_FFI_H
#define SECURE_ELEMENT_FFI_H
#include <cstdint>
#include "cj_common_ffi.h"
#include "native/ffi_remote_data.h"

namespace OHOS {
namespace SE {
namespace OMAPI {
extern "C" {
FFI_EXPORT int64_t FfiSECreateService(int32_t *errorCode);
FFI_EXPORT CArrI64 FfiSESESGetReaders(int64_t id, int32_t *errorCode);
FFI_EXPORT bool FfiSESESIsConnected(int64_t id, int32_t *errorCode);
FFI_EXPORT void FfiSESESShutdown(int64_t id, int32_t *errorCode);
FFI_EXPORT char* FfiSESESGetVersion(int64_t id, int32_t *errorCode);
FFI_EXPORT char* FfiSEReaderGetName(int64_t id, int32_t *errorCode);
FFI_EXPORT bool FfiSEReaderIsSecureElementPresent(int64_t id, int32_t *errorCode);
FFI_EXPORT int64_t FfiSEReaderOpenSession(int64_t id, int32_t *errorCode);
FFI_EXPORT void FfiSEReaderCloseSessions(int64_t id, int32_t *errorCode);
FFI_EXPORT int64_t FfiSEChannelGetSession(int64_t id, int32_t *errorCode);
FFI_EXPORT void FfiSEChannelClose(int64_t id, int32_t *errorCode);
FFI_EXPORT bool FfiSEChannelIsClosed(int64_t id, int32_t *errorCode);
FFI_EXPORT bool FfiSEChannelIsBasicChannel(int64_t id, int32_t *errorCode);
FFI_EXPORT CArrI32 FfiSEChannelGetSelectResponse(int64_t id, int32_t *errorCode);
FFI_EXPORT CArrI32 FfiSEChannelTransmit(int64_t id, CArrI32 command, int32_t *errorCode);
FFI_EXPORT int64_t FfiSESessionGetReader(int64_t id, int32_t *errorCode);
FFI_EXPORT CArrI32 FfiSESessionGetATR(int64_t id, int32_t *errorCode);
FFI_EXPORT int64_t FfiSESessionOpenBasicChannel(int64_t id, CArrI32 aid, int32_t *errorCode);
FFI_EXPORT int64_t FfiSESessionOpenBasicChannelWithP2(int64_t id, CArrI32 aid, int32_t p2, int32_t *errorCode);
FFI_EXPORT int64_t FfiSESessionOpenLogicalChannel(int64_t id, CArrI32 aid, int32_t *errorCode);
FFI_EXPORT int64_t FfiSESessionOpenLogicalChannelWithP2(int64_t id, CArrI32 aid, int32_t p2, int32_t *errorCode);
FFI_EXPORT void FfiSESessionClose(int64_t id, int32_t *errorCode);
FFI_EXPORT bool FfiSESessionIsClosed(int64_t id, int32_t *errorCode);
FFI_EXPORT void FfiSESessionCloseChannels(int64_t id, int32_t *errorCode);
}
}  // namespace OMAPI
}  // namespace SE
}  // namespace OHOS
#endif
